package com.config;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import org.springframework.context.annotation.Configuration;


/**
 * Created by 石头哥哥 on 9/2/16.
 * PACKAGE_NAME:  com.config
 * COMMENT : 配置类
 * <p>
 * DisconfFile  disconf  配置文件管理  key
 */
@Configuration
@DisconfFile(filename = "application.properties")
public class PropertiesConfig {

    /**
     * 网络连接读取数据超时次数
     */
    private int nettyReadTimeoutTimes;
    /**
     * 当前服务器端口编号
     */
    private int port;
    /**
     * 服务器连接超时时间
     */
    private int nettyConnectTimeout;
    /**
     *
     */
    private int nettyReaderIdleTime;
    /**
     * linux  epoll
     */
    private boolean epoll;





    @DisconfFileItem(name = "netty.read.timeout.times", associateField = "nettyReadTimeoutTimes")
    public int getNettyReadTimeoutTimes() {
        return nettyReadTimeoutTimes;
    }

    public void setNettyReadTimeoutTimes(int nettyReadTimeoutTimes) {
        this.nettyReadTimeoutTimes = nettyReadTimeoutTimes;
    }

    @DisconfFileItem(name = "netty.port", associateField = "port")
    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @DisconfFileItem(name = "netty.connect.timeout", associateField = "nettyConnectTimeout")
    public int getNettyConnectTimeout() {
        return nettyConnectTimeout;
    }

    public void setNettyConnectTimeout(int nettyConnectTimeout) {
        this.nettyConnectTimeout = nettyConnectTimeout;
    }

    @DisconfFileItem(name = "netty.readerIdle.time", associateField = "nettyReaderIdleTime")
    public int getNettyReaderIdleTime() {
        return nettyReaderIdleTime;
    }

    public void setNettyReaderIdleTime(int nettyReaderIdleTime) {
        this.nettyReaderIdleTime = nettyReaderIdleTime;
    }

    @DisconfFileItem(name = "netty.net.epoll", associateField = "epoll")
    public boolean isEpoll() {
        return epoll;
    }

    public void setEpoll(boolean epoll) {
        this.epoll = epoll;
    }
}
